import { defineStore } from 'pinia'
import { getConfig } from '@/api/config'

interface appConfig {
	loginConfig : Object | null | any
    styleConfig : Object | null | any
    sysConfig : Object | null | any
}

const useConfigStore = defineStore('configStore', {
	state: () : appConfig => {
		return {
			loginConfig: {},
            styleConfig: {},
            sysConfig: {},
		}
	},
	actions: {
		async getConfig() {
			const data = await getConfig({type:2});
            this.loginConfig = data.loginConfig
            this.styleConfig = data.styleConfig
            this.sysConfig = data.sysConfig
		}
	}
})

export default useConfigStore